home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 101-125 / scopedisk117 / disklabel / disklabel.rexx < prev    next >
OS/2 REXX Batch file  |  1995-03-19  |  5KB  |  113 lines

  1. /*----------------------------------------------------------------------------
  2. Arexx DiskLabel Maker
  3.    This is an updated version of my label maker.  It makes use of the
  4.    REXXARPLIB.LIBRARY v2.1 intuition functions, and is a good, easy
  5.    demo of how to use the basic functions of this library.  It will
  6.    not run unless you have this library (available on genie and compuserve).
  7.       This program is set up to use the full size disk labels for 3 1/2" disks,
  8.    it leaves the back side part blank.  It was developed using a Panasonic
  9.    KX-P1124 printer, ands the spacing works on it.  As for other printers,
  10.    you will have to try it out and adjust it if needed, but it should work
  11.    for any standard printer.  This program may be freely distributed, but please
  12.    leave the credits intact.
  13.  
  14. Tom Pennington       04/01/90
  15. -----------------------------------------------------------------------------*/
  16.  
  17. numeric digits 4
  18. /*----------------------------------------------------
  19. get the system date as the default for the requestor
  20. ------------------------------------------------------*/
  21. address command 'date > ram:today'
  22. address
  23. status = open('infile','ram:today')
  24. full_date = readln('infile')
  25. status = close('infile')
  26. date_start = index(full_date,' ')
  27. now = substr(full_date,date_start+1,9)
  28. done = 'OKAY'
  29. /*-----------------------------------------------------------
  30. this uses the postmsg function to place an informational
  31. requestor on the screen.  It does not return any user input
  32. to the program, it just displays the message text.
  33. --------------------------------------------------------------*/
  34. stat = postmsg(130,70,'    Written By\    Tom Pennington')
  35. /*--------------------------------------------------------------------
  36. some type of timming loop is needed so that the message can be read
  37. ---------------------------------------------------------------------*/
  38. call wait 2
  39. stat = postmsg(130,70,'    Using Arexx\    and RexxArpLibv2.1')
  40. call wait 2
  41. /*------------------------------------------------
  42. this clears the message requestor from the screen
  43. -------------------------------------------------*/
  44. stat = postmsg(130)
  45. do While done = 'OKAY'
  46. /*-------------------------------------------------------------------
  47. this calls the string requestor from the library, and allows
  48. for user input.  If any fields are to be ignored, they must
  49. still have commas to designate their place in the call parameters
  50. ----------------------------------------------------------------------*/
  51. disks = request(120,60,'Enter the number of\disks in the saveset','1',,'quit')
  52. /*-----------------------------------
  53. this is simple data validation,
  54. you can't print Z labels or ( times
  55. ------------------------------------*/
  56. if disks < '1' then call cleanup
  57. if disks >= ':' then call cleanup
  58. ssname = request(120,60,'Enter the Volume Name','SYSTEM',,)
  59. series = request(120,60,'Enter the Volume Series','1',,)
  60. btype = request(120,60,'Enter the Backup Type','Full',,)
  61. dates = request(120,60,'Enter the Backup Date',now,,)
  62. /*---------------------------------------
  63. give them one last chance to chicken out
  64. ----------------------------------------*/
  65. confirm = request(120,60,'Ready to Print?',,'continue','abort')
  66. if confirm ~= 'OKAY' then call cleanup
  67. /*------------------------------------------------------
  68. open the prt: device as the output file and write to it
  69. using normal default printer settings, there are 18 lines
  70. of text on a standard 3 1/2  inch disk label.
  71. --------------------------------------------------------*/
  72. stat = open('outfile','prt:','W')
  73. do i = 1 to disks
  74.   do h = 1 to 5
  75.     stat = writeln('outfile',' ')
  76.   end h
  77.   stat = writeln('outfile','SaveSet Name: 'ssname)
  78.   stat = writeln('outfile',' ')
  79.   stat = writeln('outfile','Series: 'series)
  80.   stat = writeln('outfile',' ')
  81.   stat = writeln('outfile','Volume Number:' i)
  82.   stat = writeln('outfile',' ')
  83.   stat = writeln('outfile','Backup Type:' btype)
  84.   stat = writeln('outfile',' ')
  85.   stat = writeln('outfile','Date: ' dates)
  86.   do h = 1 to 4
  87.     stat = writeln('outfile',' ')
  88.   end h
  89. end i
  90. done = request(120,60,'More Labels?',,'OKAY','QUIT')
  91. end
  92. call cleanup
  93.  
  94. cleanup:
  95. stat = close('outfile')
  96. /*------------------------------
  97.  get rid of temporary date file
  98. --------------------------------*/
  99. address command 'delete ram:today'
  100. exit
  101. /*==================================================
  102. this is a simple timming loop, it does nothing else
  103. it is like a wait command in any other language.  To
  104. use it, call wait <seconds>
  105. ====================================================*/
  106. wait:
  107. parse arg duration
  108. end_time = time('S') + duration
  109. do while time('S') < end_time
  110. z = 1
  111. end
  112. return
  113.